Skip to content

[New Rule] Third-Party Security Software Unload or Tamper via Launchctl - #7161

Open
litemars wants to merge 5 commits into
mainfrom
new_rule/unloading_security_software_macos
Open

litemars wants to merge 5 commits into
mainfrom
new_rule/unloading_security_software_macos

Conversation

@litemars

Copy link
Copy Markdown
Contributor

Summary - What I changed

Adds a macOS Elastic Defend rule that alerts when launchctl unloads, boots out, removes, or disables a third-party EDR, consumer antivirus, or endpoint telemetry/device-control agent, or when mdatp, falconctl, or sentinelctl is used to disable or unload that product. This covers defense evasion where an adversary with admin rights stops a security sensor before follow-on activity (T1562.001). The rule has been created to fill the gap of the ART test.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@litemars
litemars marked this pull request as ready for review November 10, 2026 10:08
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Generic path exclusions allow unsigned, attacker-controlled executables to unload security tools without alerting, creating a critical detection bypass.

1 open issue
What changed in this PR

Adds a macOS Elastic Defend detection rule for attempts to stop or disable third-party security software, addressing an Atomic Red Team coverage gap.

Changes:

  • Detects security-agent unloads through launchctl and tampering through mdatp, falconctl, and sentinelctl.
  • Adds parent-process exclusions to reduce maintenance-related alerts.
  • Includes investigation and setup guidance with MITRE ATT&CK T1562.001 mapping.
File Description
rules/​macos/​defense_evasion_security_software_unload_via_launchctl.toml Adds the EQL detection, exclusions, rule metadata, and investigation guide.

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

language = "eql"
license = "Elastic License v2"
name = "Third-Party Security Software Unload or Tamper via Launchctl"
note = """## Triage and analysis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description and investigation guide say several things are excluded that the query doesn't exclude.

process.parent.code_signature.trusted == true
) and
not process.parent.executable like~ "/usr/local/jamf/bin/jamf" and
not process.Ext.effective_parent.executable like~ (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align MDM exclusions with other recent rules

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do an alignment of all the MDM solution a bit later this year, also for all the old rules

Comment on lines +102 to +134
process where host.os.type == "macos" and event.type == "start" and
(
(
process.name == "launchctl" and
process.args in ("unload", "bootout", "remove", "disable") and
process.command_line like~ (
"*com.crowdstrike.*", "*com.carbonblack.*", "*com.vmware.carbonblack.*", "*com.microsoft.fresno*",
"*com.microsoft.wdav*", "*com.sentinelone.*", "*com.jamf.protect*", "*com.paloaltonetworks.cortex*",
"*com.trendmicro.*", "*com.sophos.*", "*com.eset.*", "*com.kaspersky.*", "*com.bitdefender.*",
"*com.malwarebytes.*", "*com.cylance.*", "*com.mcafee.*", "*com.trellix.*", "*com.symantec.*",
"*com.fortinet.fortiedr*", "*com.checkpoint.*", "*com.cybereason.*", "*com.huntress.*",
"*com.withsecure.*", "*com.f-secure.*", "*com.avast.*", "*com.avg.*", "*com.norton.*",
"*com.webroot.*", "*com.objective-see.*", "*com.facebook.osquery*", "*io.kolide.*",
"*com.fleetdm.*", "*com.absolute.*", "*at.obdev.*", "*com.opendns.*"
)
) or
(process.name == "mdatp" and process.args == "config" and process.args == "real-time-protection" and process.args == "disabled") or
(process.name == "falconctl" and process.args in ("unload", "uninstall")) or
(process.name == "sentinelctl" and process.args in ("unload", "unprotect", "uninstall"))
) and
not (
process.parent.executable like~ "/Library/PrivilegedHelperTools/*" and
process.parent.code_signature.trusted == true
) and
not process.parent.executable like~ "/usr/local/jamf/bin/jamf" and
not process.Ext.effective_parent.executable like~ (
"/usr/local/jamf/bin/jamf",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process where host.os.type == "macos" and event.type == "start" and
(
(
process.name == "launchctl" and
process.args in ("unload", "bootout", "remove", "disable") and
process.command_line like~ (
"*com.crowdstrike.*", "*com.carbonblack.*", "*com.vmware.carbonblack.*", "*com.microsoft.fresno*",
"*com.microsoft.wdav*", "*com.sentinelone.*", "*com.jamf.protect*", "*com.paloaltonetworks.cortex*",
"*com.trendmicro.*", "*com.sophos.*", "*com.eset.*", "*com.kaspersky.*", "*com.bitdefender.*",
"*com.malwarebytes.*", "*com.cylance.*", "*com.mcafee.*", "*com.trellix.*", "*com.symantec.*",
"*com.fortinet.fortiedr*", "*com.checkpoint.*", "*com.cybereason.*", "*com.huntress.*",
"*com.withsecure.*", "*com.f-secure.*", "*com.avast.*", "*com.avg.*", "*com.norton.*",
"*com.webroot.*", "*com.objective-see.*", "*com.facebook.osquery*", "*io.kolide.*",
"*com.fleetdm.*", "*com.absolute.*", "*at.obdev.*", "*com.opendns.*"
)
) or
(process.name == "mdatp" and process.args == "config" and process.args == "real-time-protection" and process.args == "disabled") or
(process.name == "falconctl" and process.args in ("unload", "uninstall")) or
(process.name == "sentinelctl" and process.args in ("unload", "unprotect", "uninstall"))
) and
not (
process.parent.executable like~ "/Library/PrivilegedHelperTools/*" and
process.parent.code_signature.trusted == true
) and
not process.parent.executable like~ "/usr/local/jamf/bin/jamf" and
not process.Ext.effective_parent.executable like~ (
"/usr/local/jamf/bin/jamf",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent"
)
process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
(
(
process.name == "launchctl" and
process.args in ("unload", "bootout", "remove", "disable", "kill") and
process.command_line like~ (
"*com.crowdstrike.*", "*com.carbonblack.*", "*com.vmware.carbonblack.*", "*com.microsoft.fresno*",
"*com.microsoft.wdav*", "*com.sentinelone.*", "*com.jamf.protect*", "*com.paloaltonetworks.cortex*",
"*com.trendmicro.*", "*com.sophos.*", "*com.eset.*", "*com.kaspersky.*", "*com.bitdefender.*",
"*com.malwarebytes.*", "*com.cylance.*", "*com.mcafee.*", "*com.trellix.*", "*com.symantec.*",
"*com.fortinet.fortiedr*", "*com.checkpoint.*", "*com.cybereason.*", "*com.huntress.*",
"*com.withsecure.*", "*com.f-secure.*", "*com.avast.*", "*com.avg.*", "*com.norton.*",
"*com.webroot.*", "*com.objective-see.*", "*com.facebook.osquery*", "*io.kolide.*",
"*com.fleetdm.*", "*com.absolute.*", "*at.obdev.*", "*com.opendns.*",
"*com.cisco.amp*", "*com.rapid7.*", "*com.qualys.*", "*com.tenablesecurity.*",
"*com.wazuh.*", "*com.netskope.*", "*com.zscaler.*"
)
) or
(
(process.name == "mdatp" or process.executable like~ "/Applications/Microsoft Defender.app/*") and
process.args == "config" and
(
(process.args in ("real-time-protection", "behavior-monitoring", "tamper-protection") and process.args == "disabled") or
(process.args == "passive-mode" and process.args == "enabled")
)
) or
(process.name == "falconctl" and process.args in ("unload", "uninstall")) or
(process.name == "sentinelctl" and process.args in ("unload", "unprotect", "uninstall"))
) and
not (
process.parent.executable like~ "/Library/PrivilegedHelperTools/*" and
process.parent.code_signature.trusted == true
) and
not process.parent.executable == "/usr/local/jamf/bin/jamf" and
not process.Ext.effective_parent.executable in (
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
"/usr/local/jamf/bin/jamf",
"/opt/jc/bin/jumpcloud-agent",
"/Library/Addigy/go-agent",
"/Library/Addigy/auditor",
"/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
"/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
"/Library/Kandji/Kandji Agent.app/Contents/Helpers/Kandji Library Manager.app/Contents/MacOS/kandji-library-manager",
"/Library/Iru/Iru Agent.app/Contents/Helpers/Iru Library Manager.app/Contents/MacOS/kandji-library-manager",
"/usr/local/sbin/FileWave.app/Contents/MacOS/fwcld",
"/Library/PrivilegedHelperTools/com.jigsaw24.Elevate24Helper.app/Contents/MacOS/com.jigsaw24.Elevate24Helper"
)

- Reset credentials for the user account involved if the activity originated from a compromised session.
"""
references = [
"https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1685/T1685.md",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does matches current one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it does

litemars and others added 2 commits December 1, 2026 11:33
…hctl.toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
…hctl.toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants